<template>
  <div class="hv-spinning" v-show="show">
    <div class="hv-spinning-backdrop"></div>
    <div class="hv-spinning-container">
      <a-spin :delay="500"/>
    </div>
  </div>
</template>

<script lang="ts">
  import { useSpinningStore } from '@/visual/stores/spinning';
  import { computed, defineComponent } from 'vue';

  export default defineComponent({
    name: 'Spinning',
    setup() {
      const useSpinning = useSpinningStore();
      const show = computed(() => useSpinning.getSpinningVisible || false);
      return {
        show,
      };
    },
  });
</script>

<style lang="less" scoped>
  @import './Spinning.less';
</style>
